//
//  WebViewController.m
//  RenrenMiju
//
//  Created by Xy on 15/12/7.
//  Copyright © 2015年 Xy. All rights reserved.
//

#import "WebViewController.h"
#import <WebKit/WebKit.h>
@interface WebViewController ()<UITabBarDelegate, UIWebViewDelegate>

@end

@implementation WebViewController



- (void)viewDidLoad {
    [super viewDidLoad];
//    [self WebUrl:self.url];
    NSLog(@"%@", self.url);
//    WKWebView *web = [WKWebView alloc] initWithFrame:<#(CGRect)#>
    UIWebView *web = [ [UIWebView alloc] initWithFrame:self.view.bounds];
    /*
    [XYNetWorkTool getWithUrl:self.url parameter:nil httpHeader:nil responseType:ResponseTypeDATA success:^(id result) {
        NSString *str = [[NSString alloc] initWithData:result encoding:NSUTF8StringEncoding];
        [web loadHTMLString:str baseURL:nil];
    } fail:^(NSError *error) {
        
    }];
     */
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.url]];
    [web loadRequest:request];
    web.userInteractionEnabled = YES;
    [self.view addSubview:web];
                      
}

- (void)WebUrl:(NSString *)weburl {
    UIWebView *web = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HIGHT-20)];
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:weburl]];
    web.scalesPageToFit = YES;
    [web loadRequest:request];
    web.delegate = self;
    [self.view addSubview:web];
//    [self addreturnbackView];
}




- (void)HttpURL:(NSString *)strURL {
    UIWebView *web = [[UIWebView alloc] initWithFrame:self.view.bounds];
    web.scalesPageToFit = YES;
    [web loadHTMLString:strURL baseURL:nil];
    [self.view addSubview:web];
}
//- (void)addreturnbackView {
//    UIView *bottomview = [[UIView alloc] initWithFrame:CGRectMake(0, HIGHT-50, WIDTH, 50*XHIGHT)];
//    bottomview.backgroundColor = [UIColor redColor];
//    [self.view addSubview:bottomview];
//}

#pragma mark - 隐藏当页的tabBar
//- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
////    [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
//    self.hidesBottomBarWhenPushed = YES;
//    return self;
//    
//    
//    
//}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
